package com.testing.hibernateapp.tapestry.pages;

import java.util.Collection;

import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.testing.hibernateapp.beans.PersonBean;
import com.testing.hibernateapp.interfaces.Person;
import com.testing.hibernateapp.service.UniversalHibernateDAO;

public class ViewPersons {
	
	@Property
	private Person person;
	
	@Inject
	private UniversalHibernateDAO<Person> hibernateDAO;
	
	public Collection<Person> getPersons() {
		hibernateDAO.setObjectClass(PersonBean.class);
		Collection<Person> collPersons = hibernateDAO.retrieve();
		System.out.println(collPersons.size());
		return collPersons;
		
	}

}
